//
//	SpecialworkImgList.m
//
//	Create by jiaming yan on 17/10/2017
//	Copyright © 2017. All rights reserved.
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "SpecialworkImgList.h"

NSString *const kSpecialworkImgListImgId = @"imgId";
NSString *const kSpecialworkImgListPicHeight = @"picHeight";
NSString *const kSpecialworkImgListPicKey = @"picKey";
NSString *const kSpecialworkImgListPicWidth = @"picWidth";

@interface SpecialworkImgList ()
@end
@implementation SpecialworkImgList




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kSpecialworkImgListImgId] isKindOfClass:[NSNull class]]){
		self.imgId = [dictionary[kSpecialworkImgListImgId] integerValue];
	}

	if(![dictionary[kSpecialworkImgListPicHeight] isKindOfClass:[NSNull class]]){
		self.picHeight = [dictionary[kSpecialworkImgListPicHeight] integerValue];
	}

	if(![dictionary[kSpecialworkImgListPicKey] isKindOfClass:[NSNull class]]){
		self.picKey = dictionary[kSpecialworkImgListPicKey];
	}	
	if(![dictionary[kSpecialworkImgListPicWidth] isKindOfClass:[NSNull class]]){
		self.picWidth = [dictionary[kSpecialworkImgListPicWidth] integerValue];
	}

	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	dictionary[kSpecialworkImgListImgId] = @(self.imgId);
	dictionary[kSpecialworkImgListPicHeight] = @(self.picHeight);
	if(self.picKey != nil){
		dictionary[kSpecialworkImgListPicKey] = self.picKey;
	}
	dictionary[kSpecialworkImgListPicWidth] = @(self.picWidth);
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	[aCoder encodeObject:@(self.imgId) forKey:kSpecialworkImgListImgId];	[aCoder encodeObject:@(self.picHeight) forKey:kSpecialworkImgListPicHeight];	if(self.picKey != nil){
		[aCoder encodeObject:self.picKey forKey:kSpecialworkImgListPicKey];
	}
	[aCoder encodeObject:@(self.picWidth) forKey:kSpecialworkImgListPicWidth];
}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.imgId = [[aDecoder decodeObjectForKey:kSpecialworkImgListImgId] integerValue];
	self.picHeight = [[aDecoder decodeObjectForKey:kSpecialworkImgListPicHeight] integerValue];
	self.picKey = [aDecoder decodeObjectForKey:kSpecialworkImgListPicKey];
	self.picWidth = [[aDecoder decodeObjectForKey:kSpecialworkImgListPicWidth] integerValue];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	SpecialworkImgList *copy = [SpecialworkImgList new];

	copy.imgId = self.imgId;
	copy.picHeight = self.picHeight;
	copy.picKey = [self.picKey copyWithZone:zone];
	copy.picWidth = self.picWidth;

	return copy;
}
@end